<% if @attendees.to_a.count > 0 %>
<div class="row" >

<div class="table-responsive">
  <table class="table table-striped table-bordered">
    <tbody>
    <% 
      session = Session.find(params[:session_id])
      session_seat_properties = session.try(:session_seat).try(:properties)
      display_table_num = session_seat_properties['set_table_num'] if session_seat_properties.present?
    %>
    <% @attendees.each do |attendee|%>
    <tr>
      <% seat = Seat.attendee_seat_is(attendee, session).try(:first) %>
      <% if seat.present? %>
        <td class="text-center">
          座位:<%= seat.table_row %>桌<%= display_table_num=="true" ? "#{seat.table_col}号" : "" %>
        </td>
      <% else %>
        <td class="text-center">
          <%=attendee.session_checked_in_at.in_time_zone('Beijing').to_s(:time_only)%>
        </td>
      <% end %>
      <td title="<%=attendee.mobile%>"><%=attendee.name%></td>
      <td class="text-center">
        <% style = (attendee.printed_at.present? ? 'btn-white' : 'btn-primary') %>
        <%= link_to 'javascript:;', class: "btn #{style} btn-xs site-print-pdf-btn", data: { pdf: badge_event_attendee_path(id: attendee.id, format: :pdf) } do%>
          <i class="fa fa-print"></i>
        <% end %>
        &nbsp;
        <% if attendee.rfid_num.present? %>
          <%= link_to '再次绑定rfid', 'javascript:;', class: 'btn btn-white btn-xs bind-rfid', data: { attendee_id: attendee.id } %>
        <% else %>
          <%= link_to '绑定rfid', 'javascript:;', class: 'btn btn-white btn-xs bind-rfid', data: { attendee_id: attendee.id } %>
        <% end %>
        <%= link_to 'javascript:;', data: {token: attendee.token}, class: 'btn btn-white btn-xs site-uncheck-in-btn' do %>
          <i class="fa fa-times"></i>
        <% end %>
      </td>
    </tr>
    <% end %>
    </tbody>
  </table>
</div>

</div>
<% end %>